package com.henu.engineer

import com.henu.engineer.service.UserService

/**
 *
 * @author noexcept
 * @since 2021/8/13 0:30
 */
object StringUtils {
    fun isEmpty(vararg args: String?): Boolean {
        for (i in args.indices) {
            if (args[i] == null || args[i] == "")
                return true
        }
        return false
    }

    /**
     * 判断是不是除管理员以外的有效身份
     */
    fun isValidRankElseAd(rank: String?): Boolean {
        return when (rank) {
            UserService.STUDENT -> true
            UserService.TEACHER -> true
            UserService.COURSE_LEADER -> true
            UserService.PROFESSIONAL_LEADER -> true
            UserService.DEPART_LEADER -> true
            else -> false
        }
    }
}